import pymongo

myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["zhouheng"]
mycol = mydb["sites"]

myquery = {"alexa": "10000"}
newvalues = {"$set": {"alexa": "12345"}}

mycol.update_one(myquery, newvalues)

# 输出修改后的  "sites"  集合
for x in mycol.find():
    print(x)